<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" xmlns:th="http://www.thymeleaf.org" >
    <title>修改用户</title>
    <link rel="stylesheet"th:href="@{static/css/user.css}"type="text/css"></link>
</head>
<body>
<h1>修改用户</h1>
<form th:action="@{/user}" method="post">

    <!--隐藏域的方式设置请求方式为put请求-->
<!--    修改是 put 请求-->
    <input type="hidden" name="_method" value="put">
    <!--隐藏域的方式提交id-->
    <input type="hidden" name="id" th:value="${user.id}">

    <label>用户名:</label>
    <input type="text" name="username" th:value="${user.username}" required>

    <label>性别:</label>
    <select name="sex" required>
        <option value="">-- 请选择 --</option>
        <option value="1" th:field="${user.sex}">男</option>
        <option value="0" th:field="${user.sex}">女</option>
    </select>

    <label>邮箱:</label>
    <input type="email" name="email" th:value="${user.email}" required>

    <button type="submit">修改</button>
</form>
</body>
</html>